package org.ucas.kgraph.utils.exception;

import org.springframework.http.HttpStatus;
import org.ucas.kgraph.utils.constants.ErrCode;

/**
 * 资源未发现类异常
 * @author suemi
 */
public class NotFoundException extends RestException {

  public static final NotFoundException User_NotExists =
          new NotFoundException(ErrCode.USER_NOTEXISTS);

  public static final NotFoundException Term_NotExists =
          new NotFoundException(ErrCode.TERM_NOTEXISTS);

  public static final NotFoundException Relation_NotExists =
          new NotFoundException(ErrCode.RELATION_NOTEXISTS);

  private NotFoundException(ErrCode errCode) {
    super(errCode);
  }

  public static NotFoundException of(String msg) {
    return new NotFoundException(new ErrCode(
            HttpStatus.NOT_FOUND, msg));
  }
}
